<?php

declare(strict_types=1);

namespace app\model;

use think\model\Pivot;
use think\model\concern\SoftDelete;

class AuthRolePerm extends Pivot
{
    use SoftDelete;

    protected $name = 'auth_role_perm';

    protected $autoWriteTimestamp = 'datetime';

    public function role()
    {
        return $this->belongsTo(AuthRole::class, 'role_id');
    }

    public function permission()
    {
        return $this->belongsTo(AuthPermission::class, 'permission_id');
    }
}
